package com.bitdf.txing.group.to;

import com.baomidou.mybatisplus.annotation.TableId;
import com.bitdf.txing.group.valid.SaveVaild;
import com.bitdf.txing.group.valid.UpdateValid;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 用于发布组团时收集信息
 * @author Lizhiwei
 * @date 2023/1/24 3:44:13
 * 注释：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GroupInfoTo {
    /**
     * id
     */
    @Null(message = "不可指定id",groups = {SaveVaild.class})
    @NotNull(message = "必须指定id",groups = {UpdateValid.class})
    private Long id;
    /**
     * （发起人）用户id
     */
    @Null(message = "用户id必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private Long userId;
    /**
     * 标题
     */
    @NotBlank(message = "标题需要大于5个且小于100个字符",groups = {SaveVaild.class})
    @Length(min = 5,max = 100,message = "标题需要大于5个且小于100个字符",groups = {SaveVaild.class, UpdateValid.class})
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = "内容需要大于5个且小于2000个字符",groups = {SaveVaild.class})
    @Length(min = 5,max = 2000,message = "内容需要大于5个且小于2000个字符",groups = {SaveVaild.class,UpdateValid.class})
    private String content;
    /**
     * 发布时间
     */
    @Null(message = "发布时间必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private Date publishTime;
    /**
     * 团队id（可为空）
     */
    private Long teamId;
    /**
     * 创建时间
     */
    @Null(message = "创建时间必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private Date createTime;
    /**
     * 组团状态（0：未发布 1：组团中 2：已完成）
     */
    @Null(message = "组团状态必须为空",groups = {SaveVaild.class})
    @Range(max = 3,min = 0,message = "状态值：0~3",groups = {UpdateValid.class})
    private Integer status;
    /**
     * 活动地址
     */
    @NotBlank(message = "活动地址需要大于5个且小于100个字符",groups = {SaveVaild.class})
    @Length(min = 5,max = 100,message = "活动地址需要大于5个且小于100个字符",groups = {SaveVaild.class, UpdateValid.class})
    private String address;
    /**
     * 评分
     */
    @Null(message = "评分必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private BigDecimal grade;
    /**
     * 点赞数
     */
    @Null(message = "点赞数必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private Integer likeCount;
    /**
     * 收藏数
     */
    @Null(message = "收藏数必须为空",groups = {SaveVaild.class,UpdateValid.class})
    private Integer collectCount;
    /**
     * 评论数
     */
    @Null(message = "评论数必须为空",groups = {SaveVaild.class, UpdateValid.class})
    private Integer commentCount;
    /**
     * 所属分类id
     */
    @NotNull(message = "所属分类id不得为空",groups = {SaveVaild.class})
    private Integer categoryId;
    /**
     * 浏览量
     */
    @Null(message = "浏览量必须为空", groups = {SaveVaild.class,UpdateValid.class})
    private Integer viewCount;
    /**
     * 团队所需总人数
     */
    @NotNull(message = "人数不得为空", groups = {SaveVaild.class})
    private Integer sumPersonCount;
    /**
     * 目前人数
     */
    @Null(message = "目前人数必须为空", groups = {SaveVaild.class})
    private Integer currentPersonCount;
    /**
     * ip所在地
     */
    @Length(min = 5,max = 100,message = "ip所在地需要大于5个且小于100个字符",groups = {SaveVaild.class, UpdateValid.class})
    private String ipAddr;
    /**
     * 项目图片集合
     */
    @NotEmpty(message = "项目图片集合不得为空", groups = {SaveVaild.class})
    private List<String> imgList;
    /**
     *  父分类id
     */
    @NotNull(message = "父分类id不得为空", groups = {SaveVaild.class})
    private Integer parentCategoryId;
    /**
     * 封面图
     */
    @NotBlank(message = "封面图不得为空", groups = {SaveVaild.class})
    private String surfaceImg;
}
